var uwallet;
var userinfo;
function getcash(){
    var obj=$("#getcash_frm_main").serializeObject();
    if(obj.cashnumber<=0){
        pop_up('提现金额错误');
        return;
    }
    if(uwallet.commissionBalance<=0){
        pop_up('余额不足');
        return;
    }
    if(parseFloat(obj.cashnumber)>parseFloat(uwallet.commissionBalance)){
        pop_up('余额不足');
        return;
    }
    var getcashorder={};
    // getcashorder.memberId=userinfo.id;
    // getcashorder.applyUser_id=userinfo.id;
    getcashorder.cashAmount=parseFloat(obj.cashnumber);
    // getcashorder.chargeFee=0;
    // getcashorder.actualAmount=parseFloat(obj.cashnumber)-parseFloat(getcashorder.charge_fee);
    // getcashorder.status=1;
    getcashorder.cashStyle=1;
    // getcashorder.description=userinfo.nickname+"("+userinfo.name+")"
    server.req('wechat/membercashapply/getcash',getcashorder,function (res) {
        console.log(res);
        if(res.code==0){
            pop_up('提现申请已提交，请等待审核');
            server.loadindex('page/user/mywallet/mywallet');
        }
    },null,"POST")
};

server.getUserInfo(function (res) {
    userinfo = res;
    console.log(userinfo);
})
server.req('wechat/memberwallet/getbymemberid',{},function (res) {
    if(res.code==0){
        console.log(res)
        uwallet = res.data;
        server.loadData(".cash",res.data)
    }
})
